<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">
	
	<f:metadata>  
	    <f:viewParam name="reservationId" value="#{reservationBean.reservationId}" />
	    <f:event listener="#{reservationBean.loadData}" type="preRenderView"/>  
	</f:metadata> 

	<br />
  	<p:fieldset legend="Riepilogo prenotazione">  
	    <h:panelGrid columns="2" cellpadding="10">  
	        <p:graphicImage width="300px" value="/images/packages/#{reservationBean.reservation.package.id}.jpg" />  
	        <p:panel>

	        	<table cellpadding="10px">
					<tr>
						<td>Pacchetto viaggio:</td>
						<td>#{reservationBean.reservation.package.name}</td>
						<td></td>
					</tr>
					<tr>
						<td>Località:</td>
						<td>#{reservationBean.reservation.package.location.name}</td>
						<td></td>
					</tr>
					<tr>
						<td>Numero di persone:</td>
						<td>#{reservationBean.reservation.peopleNumber} persone</td>
						<td></td>
					</tr>
					<tr>
						<td>Soggiorno in hotel:</td>
						<td>
							#{reservationBean.reservation.hotelAvailability.hotelName}<br/>
							Tipologia camera: #{reservationBean.reservation.hotelAvailability.room.name}, predisposta per #{reservationBean.reservation.hotelAvailability.room.beds} persone<br />
							Periodo: dal 
							<h:outputText value="#{reservationBean.reservation.hotelAvailability.fromDate}" >
								<f:convertDateTime pattern="dd.MM.yyyy" />
							</h:outputText> al 
							<h:outputText value="#{reservationBean.reservation.hotelAvailability.toDate}" >
								<f:convertDateTime pattern="dd.MM.yyyy" />
							</h:outputText>
						</td>
					</tr>
					<tr>
						<td>Escursione:</td>
						<td>
							#{reservationBean.reservation.excursionAvailability.excursionName}<br/>
							Data escursione: dal 
							<h:outputText value="#{reservationBean.reservation.excursionAvailability.fromDate}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText> al 
							<h:outputText value="#{reservationBean.reservation.excursionAvailability.toDate}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText>
						</td>
					</tr>
					<tr>
						<td>Volo di andata:</td>
						<td>
							Compagnia aerea #{reservationBean.reservation.flight1.company}<br/>
							Partenza dall'aeroporto #{reservationBean.reservation.flight1.airport1.name} di #{reservationBean.reservation.flight1.airport1.location.name} in data
							<h:outputText value="#{reservationBean.reservation.flight1.departureTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
							Arrivo all'aeroporto #{reservationBean.reservation.flight1.airport2.name} di #{reservationBean.reservation.flight1.airport2.location.name} in data
							<h:outputText value="#{reservationBean.reservation.flight1.landingTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
						</td>
					</tr>
					<tr>
						<td>Volo di ritorno:</td>
						<td>
							Compagnia aerea #{reservationBean.reservation.flight2.company}<br/>
							Partenza dall'aeroporto #{reservationBean.reservation.flight2.airport1.name} di #{reservationBean.reservation.flight1.airport2.location.name} in data
							<h:outputText value="#{reservationBean.reservation.flight1.departureTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
							Arrivo all'aeroporto #{reservationBean.reservation.flight2.airport2.name} di #{reservationBean.reservation.flight2.airport2.location.name} in data
							<h:outputText value="#{reservationBean.reservation.flight2.landingTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
						</td>
					</tr>
				</table>
				<p:separator />
		        <p>	
		        	Prenotazione effettuata in data
		        	<h:outputText value="#{reservationBean.reservation.dateReservation}">
		        		<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
		        	</h:outputText> a nome di <h:outputText value="#{reservationBean.reservation.user.firstName} #{reservationBean.reservation.user.lastName}" /><br /> 
		        	Il costo totale della prenotazione è di #{reservationBean.reservation.price} euro.
		        </p>
	        </p:panel>  
		    
	    </h:panelGrid>  
	    
	</p:fieldset>
	
	
	
	
	</ui:define>
</ui:composition>
</html>